﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MySql.Data.MySqlClient;

namespace FindIt.DAL
{
    public class RestrictedWordDB
    {
        private string connString;
        private MySqlConnection conn;
        private MySqlCommand cmd;

        public RestrictedWordDB()
        {
            connString = System.Configuration.ConfigurationManager.AppSettings["connectionString"];
            conn = new MySqlConnection(connString);
            cmd = new MySqlCommand();
            cmd.Connection = conn;
        }

        public MySqlDataReader GetRestrictedWordsByTableName(string tableName)
        {
            conn.Open();
            string sql = "SELECT * FROM " + tableName;
            cmd.CommandText = sql;
            MySqlDataReader dr = cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
            return dr;
        }
    }
}